<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <title>文档</title>
  <link href="../css/semantic/semantic.min.css" rel="stylesheet">
  <link href="../css/markdown.css" rel="stylesheet">
    <link href="../css/wtxynavigation.css" rel="stylesheet">
    <script src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/include.js"></script>
  <style>
    body{padding-top:0;background:#f7f7f7}
    body>.ui.container{width:100%;padding:0}
    #project-title{background:#6e6e6e;width:100%;line-height:3.572rem;color:#fff;font-size:1.2rem}
    #project-title .title-wrap{font-weight:700;padding:0 12px;width:100%;max-width:1366px!important;min-width:900px;margin:0 auto}
    #project-title .left,#project-title right{display:inline-block}
    #project-title .right{float:right}
    #project-title .right .wiki-actions .menu{left:auto;right:0;margin-top:.4em!important}
    #wiki-preview-container{width:100%;max-width:1366px!important;min-width:900px;padding:0;border:1px solid #e3e9ed;border-top:0}
    #wiki-preview>.ui.segment{margin-top:0;padding:1rem;padding-left:0;border:0}
    .hover-places{display:inline-block}
    #page-detail{width:60%;margin:0 auto}
    #page-detail .title{font-weight:700;font-size:24px;padding:12px 0;border-bottom:1px solid #ccc}
    #page-detail .content{margin-top:15px}
    .content p{word-wrap:break-word}
    #wiki-parent,#wiki-title,#wikis{display:none}
    .ui.grid{padding:0!important}
    #ex-all{cursor:pointer;color:#537c8d}
  </style>
</head>
<body>
  <div class="ui container">

      <div id="wtxyNav"></div>

    <div class="ui container" id="wiki-preview-container">
      <div id="wiki-preview">
        <div class="ui segment">
          <div id="page-detail" class="markdown-body">
            <div class='title'>12.GCD同步串行补充</div><div class='content'><h1>
<a id="12gcd同步串行补充" class="anchor" href="#12gcd%E5%90%8C%E6%AD%A5%E4%B8%B2%E8%A1%8C%E8%A1%A5%E5%85%85"></a>12.GCD同步串行补充</h1>
<h2>
<a id="如下代码有问题否" class="anchor" href="#%E5%A6%82%E4%B8%8B%E4%BB%A3%E7%A0%81%E6%9C%89%E9%97%AE%E9%A2%98%E5%90%A6"></a>如下代码有问题否?</h2>
<pre><code>
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    
    
    dispatch_queue_t queue = dispatch_queue_create("com.itopengl", DISPATCH_QUEUE_SERIAL);
//    dispatch_queue_t queue = dispatch_queue_create("com.itopengl", DISPATCH_QUEUE_CONCURRENT);
    
    dispatch_sync(queue, ^{
        
        [self doSomething];
    });
    NSLog(@"===++++=======");

}



- (void)doSomething
{
    NSLog(@"%s", __func__);
}

</code></pre>
<h3>
<a id="1" class="anchor" href="#1"></a>1.</h3>
<h1>
<a id="答--没有问题" class="anchor" href="#%E7%AD%94--%E6%B2%A1%E6%9C%89%E9%97%AE%E9%A2%98"></a>答:  没有问题!</h1>
<ol>
<li>同步提交在当前线程执行</li>
<li>在不同队列里面, 没有冲突</li>
<li>上面代码和单纯调用<code>[self doSomething];</code>效果一样</li>
</ol></div>
          </div>
        </div>
      </div>
      </div>
  </div>
</body>
</html>